//
//  PMBodyDelegate.h
//  PezMonkey
//
//  Created by Spence DiNicolantonio on 12/23/09.
//  Copyright 2009 Necrosoft. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "PMCore.h"

@class PMBody;


@protocol PMBodyDelegate
@optional

#pragma mark -
#pragma mark Velocity

/**
 * Called just before a given PMBody's velocity is updated for a given time interval. 
 * The current force of gravity, in G's, and the current damping amount are provided. 
 * This method can be implemented to provide custom functionality or manipulation 
 * of the PMBody's attributes. The return value of this method determines whether 
 * the default velocity update will be performed after this method's invocation.
 */
- (BOOL)body:(PMBody *)body willUpdateVelocityWithTime:(NSTimeInterval)time gravity:(PMVect)gravity damping:(PMFloat)damping;

/**
 * Called just after a given PMBody's velocity is updated for a given time interval. 
 * This method can be implemented to provide custom functionality post velocity 
 * update.
 */
- (void)body:(PMBody *)body didUpdateVelocityWithTime:(NSTimeInterval)time;


#pragma mark -
#pragma mark Position

/**
 * Called just before a given PMBody's position is updated for a given time interval.
 * The current gravity vector and damping affecting the given body are provided.
 * This method can be implemented to provide custom functionality or manipulation 
 * of the PMBody's attributes. The return value of this method determines whether 
 * the default position update will be performed after this method's invocation. 
 * It not likely that one will return NO here. If providing a custom position 
 * update, be sure to understand the default update source.
 */
- (BOOL)body:(PMBody *)body willUpdatePositionWithTime:(NSTimeInterval)time;

/**
 * Called just after a given PMBody's position is updated for a given time interval. 
 * This method can be implemented to provide custom functionality post position update.
 */
- (BOOL)body:(PMBody *)body didUpdatePositionWithTime:(NSTimeInterval)time;

@end
